EF Core Code First

Repository Pattern

More detailed Introduction:

Purpose:

Meditates between the domain and data mapping layers, acting like an in-memory collection of domain objects

Benefits

  • Minimizes duplicate query logic
  • Decouples your application from persistence frameworks
  • Promotes testability

    Repository should not have methods like Update and Save

Unit of Work

Keeps track of changes and coordinates the writings and savings